<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import = "classes.SessionFormation" %>
<%@ page import = "interfaceDAO.SessionFormationJDBCDAO" %>
<%@ page import = "classes.Client" %>
<%@ page import = "interfaceDAO.ClientJDBCDAO" %>
<%@ page import = "java.util.ArrayList" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
		<title>Insert title here</title>
	</head>
	<body>
		<TABLE BORDER=0>
			<TR>
				<TD>Id	</TD>
				<TD>Nom	</TD>
				<TD>Prenom	</TD>
				<TD>Adresse	</TD>
				<TD>Tel</TD>
				<TD>Email</TD>
			</TR>
				<%
				long id = 0;
				if(request.getParameter("id") != null){
					id = Long.parseLong(request.getParameter("id"));
				}
				
				SessionFormationJDBCDAO sfdao = new SessionFormationJDBCDAO();
				SessionFormation sessionFormation = sfdao.getById(id);
				
				ArrayList<Client>clientsList = new ArrayList<Client>();
				ClientJDBCDAO dao = new ClientJDBCDAO();
				clientsList = dao.getClientList();
				
				for(Client next : clientsList)
				{
					if(next.getSessionId()== id)
					{
				%>
						<TR>
							<TD><%=next.getId() %>	</TD>
							<TD><%=next.getNom() %></TD>
							<TD><%=next.getPrenom() %></TD>
							<TD><%=next.getAdresse() %></TD>
							<TD><%=next.getTel() %></TD>
							<TD><%=next.getEmail() %></TD>
						</TR>	
				<%	
					}
				}%>	
		</TABLE>
	</body>
</html>